<script setup lang="ts">
const props = withDefaults(
  defineProps<{
    money?: number
    name1?: string
    age?: number
  }>(),
  {
    money: 10000
  }

)
 const emit =defineEmits<{
   (e: 'changeMoney', money: number): void
  (e: 'changeAge', age: number): void
  }>()
</script>

<template>
  <div class="Son-page">
    <h1>{{ props.name1 }}</h1>
    <h1>{{ props.money }}</h1>
    <h1>{{ props.age }}</h1>
    <button @click="emit('changeMoney',10)">赚钱</button>
    <br />
    <button @click="emit('changeAge',2)">修改年龄</button>
  </div>
</template>

<style></style>
